Count and display the vowels of a given textΒΆ
Count and display the vowels of a given text.
def vowel(S):
VS = "aeiuoAEIOU"
print(len([letter for letter in S if letter in VS]))
print([letter for letter in S if letter in VS])
# test
vowel('w3resource');
Output:
4
['e', 'o', 'u', 'e']